//
//  NRWCarDetailCell.m
//  NRWMall
//
//  Created by 张记 on 2018/5/22.
//  Copyright © 2018年 com.anpxd. All rights reserved.
//

#import "NRWCarDetailCell.h"

@interface NRWCarDetailCell ()
@property (nonatomic, strong) UIImageView *ImageView;
@property (nonatomic, strong) UIImageView *authImage;
@end

@implementation NRWCarDetailCell
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self initTopImageView];
    }
    
    return self;
}
-(void)initTopImageView{
 
    self.ImageView = DPImageView();
    self.ImageView.frame = self.frame;
    [self.ImageView setImage:[UIImage imageNamed:@"default_banner"]];
    self.ImageView.contentMode = UIViewContentModeScaleAspectFill;
    [self addSubview:self.ImageView];
    
    self.authImage = DPImageView();
    self.authImage.image = [UIImage imageNamed:@"buycar_certify"];
    self.authImage.frame = CGRectMake(SCREEN_WIDTH()- 100, SCREEN_WIDTH() * 3/ 4 - 30, 75, 20);
    self.authImage.hidden = YES;
    [self addSubview:self.authImage];

    
    UIImageView *imageTop = DPImageView();
    imageTop.image = [UIImage imageNamed:@"nav_image"];
    imageTop.frame = CGRectMake(0, 0, self.frame.size.width, 105);
    [self addSubview:imageTop];
    
}
-(void)setImageUrl:(NSString *)imageUrl{
    _imageUrl = imageUrl;
    [self.ImageView sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:[UIImage imageNamed:@"default_banner"]];
}
-(void)setIsAuth:(NSInteger)isAuth{
    if (isAuth == 10) {
        self.authImage.hidden = NO;
    }else{
        self.authImage.hidden = YES;
    }
}
@end
